#include<iostream>
#include<vector>
using namespace std;
vector<int>  reOrderArray(vector<int>& array) {
	int pre = 0;
	int l = 0;
	while (pre<array.size())
	{
		while (pre<array.size()&&array[pre] % 2 == 0)
			pre++;
		if (pre == array.size())
			return array;
		int temp = array[pre];
		array.erase(array.begin() + pre);
		array.insert(l + array.begin(), temp);
		l++;
		pre++;
	}
	return array;
}
int main()
{
	vector<int>  a{ 1, 2, 3, 4 };
	reOrderArray(a);
}